import Vue from 'vue'
import VueRouter from 'vue-router'
import UserLogin from '../login/UserLogin.vue'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'
import UserView from '../views/UserView.vue'
import EchartsView from '../views/EchartsView.vue'
import LayoutView from '../components/LayOut.vue'
import OneView from "@/views/OneView.vue";
import TwoView from "@/views/TwoView.vue";
import ThreeView from "@/views/ThreeView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'UserLogin',
    component: UserLogin
  },
  {
    path: '/section-one', // 修改为唯一路径
    component: LayoutView,
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: { title: '大标题一', icon: 'el-icon-s-home' },
    children: [
      {
        path: 'home',
        name: 'homeOne',
        component: HomeView,
        meta: { title: "首页" }
      },
      {
        path: 'about',
        name: 'aboutOne',
        component: AboutView,
        meta: { title: "关于" }
      }
    ]
  },
  {
    path: '/section-two', // 修改为唯一路径
    component: LayoutView,
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: { title: '大标题二', icon: 'el-icon-s-data' },
    children: [
      {
        path: 'user',
        name: 'userTwo',
        component: UserView,
        meta: { title: "用户管理" }
      },
      {
        path: 'echarts',
        name: 'echartsTwo',
        component: EchartsView,
        meta: { title: "图表" }
      }
    ]
  },
  {
    path: '/section-three', // 修改为唯一路径
    component: LayoutView,
    redirect: 'noRedirect',
    alwaysShow: true,
    meta: { title: '大标题三', icon: 'el-icon-s-data' },
    children: [
      {
        path: 'one',
        name: 'oneThree',
        component: OneView,
        meta: { title: "扩展页面一" }
      },
      {
        path: 'two',
        name: 'twoThree',
        component: TwoView,
        meta: { title: "扩展页面二" }
      },{
        path: 'three',
        name: 'threeThree',
        component: ThreeView,
        meta: { title: "扩展页面三" }
      }
    ]
  }
];

const router = new VueRouter({
  routes
})

export default router
